<!DOCTYPE html>
<html>
<body>
<h2>变量</h2>

<?php  
echo "https://www.w3school.com.cn/php/php_variables.asp <br>";
?>

<?php
$x=5;
$y=6;
$z=$x+$y;
echo $z;
?>

<?php
$txt = "hello world";
$x=5;
$y=10.5;
?>

<?php
$x=5;

function myTest() {
    $y = 10;
    echo "<p>test variable inside function </p>";
    echo "variable x is $x";
    echo "<br>";
    echo "variable y is: $y";
}

myTest();

echo "<p>测试函数之外的变量：</p>";
echo "变量 x 是：$x";
echo "<br>";
echo "变量 y 是：$y";
?>

</body>
</html>